var xyz = "/^" + str.replace(/[\\/$\n\r\t]/g, subst) + "$/";